package com.qmds.common.core.exception;

import com.qmds.common.core.vo.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * --- 代码敲烂 月薪过万 ---
 *
 * @author ShiJiaWei
 * @date 2024/9/7
 * @desc:
 */
@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(Exception.class)
    public R<String> exceptionHandler(Exception e) {
        e.printStackTrace();
        String info = e.getMessage();
        // e.printStackTrace();
        return R.fail(info);
    }
}
